package com.program.houai.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.program.houai.entity.UserEntity;
import com.program.houai.po.WxUserDTO;
import com.program.houai.util.R;
import com.program.houai.vo.H5UserVO;
import com.program.houai.vo.UserOrderVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author liyinsong
 * @date 2022/2/28 16:11
 */
public interface IUserService extends IService<UserEntity> {

    UserEntity selectUserByUsername(String username);

    UserEntity selectUserByOpenId(String openId);


    public R<Object> wxLogin(String code);

    boolean checkWxUser(String rawData, String signature, String sessionKey);

    WxUserDTO decryptWxUserInfo(String encryptedData, String iv, String sessionKey) throws Exception;

    int registryWxUserInfo(WxUserDTO wxUserDTO);

    boolean registryUserInfo(UserEntity userEntity);

    IPage<UserOrderVO> getAllOrderList(IPage page, List<Integer> userIdList,Integer txnStatus,String isRoyalty
    ,String startTime,String endTime);

    List<UserOrderVO> getAllOrderList(List<Integer> userIdList,Integer txnStatus,String isRoyalty
            ,String startTime,String endTime);

    public  int updateUserMoney(int userId,int money,int toalMoney);


    boolean   h5Registry(H5UserVO h5UserVO);
}
